package com.medical.manage.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName("t_article")
public class Article {
    //文章id
    @TableId(type = IdType.AUTO)
    private Integer id;
    //发布人id
    private Long userId;
    //标题
    private String title;
    //文章类型（1.创作文章2.案例文章）
    private Integer articleType;
    //文章内容
    private String articleContent;
    //图片
    private String articleImgUrl;
    //点赞数量
    @TableField(exist = false)
    private Integer likeNum;
    //收藏数量
    @TableField(exist = false)
    private Integer collectionNum;
    //浏览数量
    @TableField(exist = false)
    private Integer browseNum;
    //评论数量
    @TableField(exist = false)
    private Integer commentNum;
    //创建时间
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    //修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    //文章状态
    private Integer state;


}
